package chouXiangLeiHeJieKou.ChouXiangLeiHeJieKou2.demo1;

public class Test {
    public static void drawMap(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        //抽象的东西无法被实例化
        //Shape shape1=new Shape();
        Rect rect=new Rect();
        drawMap(rect);

        Cycle cycle=new Cycle();
        drawMap(cycle);

        drawMap(new Rect());
        drawMap(new Cycle());

        new Rect().draw();
        new Cycle().draw();

        rect.draw();
        cycle.draw();
    }
}
